﻿using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp.Domain.Entities;

namespace AbpToDomain.EntityInfo
{
    public class NeetOutMaterial : Entity
    {
        [Key]
        public Guid Id_NeetOutMaterial { get; set; }
        public DateTime CreatedDate { get; set; }
        [Comment("需求工单")]
        public string? OrderNo {  get; set; }
        [Comment("需求数量")]
        public int? NeetQuantity { get; set; }
        [Comment(" 说明-实际需求数量")]
        public string? remark {  get; set; }
        [Comment("工单号")]
        public string? moCode { get; set; }
        [Comment("站位号")]
        public string? slotNum {  get; set; }
        //[Comment("LPN")]
        //public string? MaterialCode {  get; set; }
        //foreign key 
        public MaterialBase Material { get; set; }      

        public override object[] GetKeys()
        {
            return new object[] { Id_NeetOutMaterial };
        }

        //function
        public NeetOutMaterial AddNeetOutMaterial(MaterialBase materialBase, string? OrderNo,int? NeetQuantity,string? moCode,string? slotNum,string? remark)
        {
            NeetOutMaterial neetOutMaterial = new NeetOutMaterial();
            neetOutMaterial.Material = materialBase;
            neetOutMaterial.CreatedDate = DateTime.Now;
            neetOutMaterial.OrderNo = OrderNo;
            neetOutMaterial.NeetQuantity = NeetQuantity;
            neetOutMaterial.moCode = moCode;
            neetOutMaterial.slotNum = slotNum;
            neetOutMaterial.remark = remark;
            return neetOutMaterial;
        }

        public NeetOutMaterial()
        {

        }
    }
}
